<%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@include file="../WEB-INF/jspf/controlesessao.jspf"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Alterar CursosF</title>
        <script type="text/javascript" src="../js/jquery.js" ></script>
        <script type="text/javascript" src="../js/jquery.validate.js"></script>
        <script type="text/javascript" src="../js/forms.js"></script>
        <script type="text/javascript" src="../js/jquery-ui-1.8.2.custom.min.js" ></script>
        <link rel="stylesheet" href="../css/ui-lightness/jquery-ui-1.8.2.custom.css">
    <link rel="stylesheet" href="../css/forms.css"></head>
    <script>$(document).ready(function(){
        $("#form").validate({
            rules: {
                desc_cursof: {required:true}
            },
            submitHandler: function(form) {
                salvar(form);
            }
        });
    });
    </script>


    <body>

        <form name="form" id="form" method="post" action="update.jsp" >
            <div id="formulario">
                <fieldset><legend>Dados</legend>
                    <sql:query var="query" dataSource="jdbc/dbo_MicrosoftSQLServer">SELECT  * FROM CursosF where id_cursosF=?
                        <sql:param value="${param.chave}"/>
                    </sql:query>
                    <c:forEach var="row" items="${query.rows}">
                        <input type="hidden" name="id_cursosF" size="10" maxlength="10" class="required" value="${row.id_cursosF}">
                        <p>
                        <label class="lbInput">Tipo do Curso</label>
                        <sql:query var="quCursos" dataSource="jdbc/dbo_MicrosoftSQLServer">
                            SELECT  * FROM TipoCursoF
                            order by 2
                        </sql:query>
                        <select name="id_tipocursoF" id="cursos" class="required">
                            <option value="" selected>Selecione um valor</option>
                            <c:forEach var="rowCurso" items="${quCursos.rows}">
                                <option value="${rowCurso.id_tipocursoF}" ${rowCurso.id_tipocursoF==row.id_tipocursoF?'selected':''}>${rowCurso.desc_tipocursof}</option>
                            </c:forEach>
                        </select>
                    </p>


                        <p><label class="lbInput">Descrição<em>*</em></label>
                            <input type="text" name="desc_cursoF" size="80" maxlength="80" class="required" value="${row.desc_cursof}">
                        </p>
                    </c:forEach><p>
                        <input class="submit" type="submit" value="Salvar">
                        <input class="submit" type="button" value="Remover" onclick="remover(document.forms[0])" style="visibility:visible">
                        <input class="submit" type="button" value="Listar" onclick="listar('fm_lista_CursosF.jsp')">
                    </p>
                    <div id="ajax_dados" style="display:block">
                    </div>
                    <div id="msg" style="display:none"></div>
                </fieldset>
            </div>
        <input type="hidden" id="token" name="token" value="${sessionScope.token}" /> </form>
    </body>
</html>
